1. Field of the Invention
The present invention relates to an image data compression apparatus used in a facsimile system, an image electronic file or the like and, more particularly, to an image data compression apparatus suitable for high-resolution image processing.
2. Description of the Prior Art
In conventional image transfer apparatuses such as facsimile systems and the latent image file apparatuses using optical disks, magnetic disks or the like, image data is compressed to decrease the amount of data, thereby achieving high-speed transmission and accumulation with high efficiency.
Image compression is a kind of code conversion which is typically exemplified by modified Huffman (MH) coding. According to MH coding, continuous strings of white or black pels in the image are expressed by a corresponding code. In this case, the most frequent pel number corresponds to a short code, and a rarely appearing pel number corresponds to a long code. The entire image can be expressed by a smaller number of bits in another code string by utilizing occurrence frequency for combinations of pels.
A data format using MH coding defines an EOL (end of line) code representing a boundary of an MH code group representing a one-line image, and an RTC (return to control) signal representing a boundary of a one-page image. A receiving end, i.e., a decoding processor, performs synchronous decoding in response to the EOL code and the RTC signal.
A high-speed, high-resolution printer such as a laser beam printer using electrophotographic process has recently been developed. Demand has arisen for reproduction (recording) of a compressed image by using such a printer. Along with this demand, a high-speed optical reader is also necessary for reading the image to be printed at the printer. As a result, compression and decoding must be performed at higher speeds.
Since the EOL code and the RTC signal play an important role as described above, their formation becomes an important issue. In particular, an apparatus for generating the EOL code and the RTC signal is required to perform real-time high-speed processing in a facsimile system wherein a reader, a compression apparatus, a printer and the like are independently operated with high speed.
The MH codes includes two types of codes: a terminating code and a makeup code. Numbers corresponding to 0 to 63 pels (run length) are represented by terminating codes, respectively. Numbers 64, 128, 256, . . . 2560 corresponding to pels in units of 64 pels are represented by makeup codes, respectively. A run length of 0 to 63 pels is represented by one terminating code, but a run length of 64 or longer is represented by a combination of a makeup code and a terminating code. For example, an image having a continuous string of 515-bit white pels can be expressed as (01100101) (1000), which is a combination of a makeup code (01100101) representing a white run length 512 and a terminating code (1000) representing a white run length 3, since 515=64.times.8+3=512+3.
In this manner, the terminating code and the makeup code can display maximum run lengths of 63 and 2560, respectively. When these codes are combined, a maximum of 2,623 (=2,560+63) bits can be expressed by an MH code.
In the laser beam printer described above, high-density recording/reproduction can be performed at 16 dots/mm. Therefore, a corresponding resolution is required in the reader for optically reading the image to be reproduced at the printer.
Assume that an original having an A4 (210 mm.times.297 mm) size is read with a resolution of 16 dots/mm. In this case, the total number of pels to be read is 3,360.times.4,752 (dots). When compression processing is performed using the above-mentioned MH coding, a run length which cannot be expressed by 2,560+63 bits is formed. In order to express a run length exceeding 2,653 bits, extended coding can be proposed wherein two makeup codes are used in the form of, for example, (makeup code)+(makeup code)+(terminating code).
When a one-line image along a short side of an A4-size original subjected to scanning with a resolution of 16 dots/mm comprises white pels (3,360 bits), 3,360-bits continuous white pels can be expressed by combining three MH codes, i.e., a makeup code (000000011111) representing 2,560 bits, a makeup code (011001101) representing 768 bits, and a terminating code (00011011) representing 32 bits, since 3,360=2,560+768+32.
An image having a run length of about 5,000 bits can be expressed by MH codes consisting of make up and terminating codes. In this case, however, the length of the MH code is considerably long. When a long MH code is generated at once, data conversion is overloaded. In addition, generation of the MH code is delayed, resulting in inconvenience. This drawback interferes with high-speed image transmission.
The first MH code of one line must represent a white image in accordance with a CCITT recommendation for MH coding. When a one-line image starts with a black image, an MH code of a white image having a run length 0 is inserted before an MH code for a black image, i.e., after an EOL (end of line) code. However, hardware for generating the MH code of a white image having tne run length 0 is complicated.